﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace CommentHero
{
    public partial class CommentEditor : Form
    {
        public string[] Comment
        {
            get
            {
                return rtxtComment.Lines;
            }
        }

        public string[] Summary
        {
            get
            {
                return rtxtSummary.Lines;
            }
        }

        public string[] Remarks
        {
            get
            {
                return rtxtRemarks.Lines;
            }
        }

        private CommentEditor()
        {
            InitializeComponent();
        }

        public CommentEditor(HeaderComment headerComment)
            : this()
        {
            rtxtComment.Lines = headerComment.Comment.ToArray();
            rtxtSummary.Lines = headerComment.XmlSummary.ToArray();
            rtxtRemarks.Lines = headerComment.XmlRemarks.ToArray();
        }

        public CommentEditor(List<string> comment)
            : this()
        {
            rtxtComment.Lines = comment.ToArray();
            tabCommentEditor.TabPages.Remove(tabpSummary);
            tabCommentEditor.TabPages.Remove(tabpRemarks);
        }

        private void btnEditorHelp_Click(object sender, EventArgs e)
        {
            new EditorHelpDialog().ShowDialog();
        }
    }
}